#include <iostream>
#include <ratio>

using namespace std;

int main(){
    typedef ratio<1, 3> one_third;
    using two_fourths = ratio<2, 4>;

    cout << "one_third = " << one_third::num << "/" << one_third::den << endl;
    cout << "two_fourths = " << two_fourths::num << "/" << two_fourths::den << endl;
    using sum = ratio_add<one_third, two_fourths>;
    cout << "sum = " << sum::num << "/" << sum::den;
    cout << "which is " << (double(sum::num) / sum::den) << endl;

    cout << "1 kilogram has " << (kilo::num / kilo::den) << "grams." << endl;

    return 0;
}